if (this.help || (!this.save && !this.restore)) {
	usage('save=<file>');
	usage('restore=<file>');
} else {
	include('chrome://technika/content/technika.js');

	if (this.save) {
		try {
			TH_writeFile(this.save, _pane.contentDocument.body.innerHTML);
		} catch (e) {
			error("unable to write to '" + this.save + "'");
		}
	} else if (this.restore) {
		try {
			var data = TH_readFile(this.restore);
			_pane.contentDocument.body.innerHTML = data;

			var id = '';
			var divs = _pane.contentDocument.body.getElementsByTagName('div');

			for (var i = 0; i < divs.length; i++) {
				if (divs[i].id.match(/^ln\d+$/)) {
					id = divs[i].id;
				}
			}

			this._cmdl.i = id != '' ? parseInt(id.substring(2)) : this._cmdl.i;
		} catch (e) {
			error("unable to open '" + this.restore + "'");
		}

		_pane.contentDocument.location.hash = id;
	}
}
